<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function num() {
            // 加法
            var sum = 0
            var mul = 1
            var div = arguments[0]
            var sub = arguments[0]
            for (var i = 0; i < arguments.length; i++) {
                sum += arguments[i]
            }

            // 乘法
            for (var j = 0; j < arguments.length; j++) {
                mul *= arguments[j]
            }

            // 除法
            for (var n = 1; n < arguments.length; n++) {
                div /= arguments[n]
            }

            // 减法
            for (var m = 1; m < arguments.length; m++) {
                sub -= arguments[m]
            }
            return ['数字之和：' + sum, '数字之积：' + mul, '数字之商：' + div, '数字之差：' + sub]
        }
        console.log(num(7, 8, 9, 10))
    </script>
</body>

</html>